﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="PriceAreas.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Tìm Giá Theo Khu Vực </title>
    <script src="assets/js/Admin_002.js" type="text/javascript"></script>
    <script src="assets/js/Admin.js" type="text/javascript"></script>
    <script src="assets/js/Validation.js" type="text/javascript"></script>
    <script src="assets/js/jquery-1.4.2.js" type="text/javascript"></script>
    <%--<script type="text/javascript"
		src="http://code.jquery.com/jquery-1.5.2.min.js"></script>--%>
    <script src="assets/jquery/jquery-ui.min.js" type="text/javascript"></script>
    <script src="assets/jquery/jquery.dialog.extra.js" type="text/javascript"></script>
    <script type='text/javascript' src="assets/js/jquery.bgiframe.min.js"></script>
    <script type='text/javascript' src="assets/js/jquery.ajaxQueue.js"></script>
    <script type='text/javascript' src="assets/js/thickbox-compressed.js"></script>
    <script type='text/javascript' src="assets/js/jquery.autocomplete.js"></script>
    <script type='text/javascript' src="assets/js/Ports.js"></script>
    <script type='text/javascript' src="Assets/js/jquery-custom-1.0.0.js?v=0611"></script>
    <script type='text/javascript' src="Assets/js/zoom.js"></script>
    <script type='text/javascript' src="assets/js/Carrs.js"></script>
    <script type='text/javascript' src="Assets/js/updatepriceAreas.js"></script>
    <script type='text/javascript' src="Assets/js/encoder.js"></script>
    <script type='text/javascript' src="Assets/jquery/jquery.cookie.js"></script>
    <link href="assets/jquery/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="assets/css/jquery.autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="assets/css/thickbox.css" />
    <link rel="stylesheet" href="assets/css/reset.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/styleexpress.css" type="text/css" />
    <link rel="stylesheet" href="assets/css/invalid.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="Assets/css/EditTableCell.css" type="text/css" />
    <link rel="stylesheet" href="Assets/css/zoom.css" type="text/css" />
    <link rel="stylesheet" type="text/css" href="assets/css/datepicker.css" />
    <script type='text/javascript' src="assets/js/jquery.ui.datepicker.js"></script>
    <script type="text/javascript" language="javascript">
        var nPermissions = '<%=nPermissions %>';
        function getUrlVars() {
            var vars = {};
            var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function (m, key, value) {
                vars[key] = value;
            });
            return vars;
        }
        function doDelete(strID, strName) {
            if (confirm('Bạn có thực sự muốn xóa ' + strName + '?')) {
                var vnpage = getUrlVars()['page_number'];
                if (vnpage)
                    window.location.href = "PriceAreas.aspx?action=delete&ID=" + strID + "&page_number=" + vnpage;
                else
                    window.location.href = "PriceAreas.aspx?action=delete&ID=" + strID;
            }
        }
        function doPublic(strID, strName) {
            //if (confirm('Bạn có thực sự muốn public ' + strName + '?')) {
            var vnpage = getUrlVars()['page_number'];
            if (vnpage)
                window.location.href = "PriceAreas.aspx?action=public&ID=" + strID + "&page_number=" + vnpage;
            else
                window.location.href = "PriceAreas.aspx?action=public&ID=" + strID;
            //}
        }
        $().ready(function () {
            $('#txtCarrNameSearch').focus().autocomplete(carrs);
            $('#txtPOLSearch').focus().autocomplete(ports);
            $('#txtPODSearch').focus().autocomplete(ports);
            $("#btnShowAddNewBox").click(function () {
                if ($(this).val() == "Add new") {
                    $("#addnewbox").show();
                    $(this).val("Hide");
                }
                else {
                    $("#addnewbox").hide();
                    $(this).val("Add new");
                }
            });
        });         
    </script>
    <style type="text/css">
        .groupheader
        {
            background: #efefef !important;
            text-transform: uppercase;
            text-align: center;
        }
        .groupheader td
        {
            text-align: center;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/top.ascx"-->
        </div>
        <div id="main-content1">
            <h2>
                PRICE AREAS
            </h2>
            <div class="clear">
            </div>
            <div class="content-box">
                <form id="frmPriceAreas" runat="server" autocomplete="off">
                <div zoomable="true">
                    <%if (nPermissions >= 3)
                  { %>
                    <div id="addnewbox" style="display: none; margin: 5px;">
                        Add New Service Area:
                        <asp:DropDownList ID="ddNewServiceArea" runat="server">
                        </asp:DropDownList>
                        &nbsp;
                        <asp:Button ID="btnAddNew" runat="server" OnClick="btnAddNew_Click" CssClass="button"
                            Text="Save" />
                    </div>
                    <%} %>
                    <div style="height: auto; padding-top: 7px;">
                        <span style="background: #e5e5e5 url('/assets/images/bg-content-box.gif') top left repeat-x;
                            padding: 10px; border-radius: 7px; margin-right: 20px;">FILTER DATA
                            <asp:DropDownList ID="ddCarr" runat="server" OnSelectedIndexChanged="ddCarr_SelectedIndexChanged"
                                AutoPostBack="true">
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddPol" runat="server" OnSelectedIndexChanged="ddPol_SelectedIndexChanged"
                                AutoPostBack="true">
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddPod" runat="server" OnSelectedIndexChanged="ddPod_SelectedIndexChanged"
                                AutoPostBack="true">
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddGroupAreas" runat="server" OnSelectedIndexChanged="ddGroupAreas_SelectedIndexChanged"
                                AutoPostBack="true">
                            </asp:DropDownList>
                        </span>
                        <% if(nPermissions > 3) {%>
                        <span style="background: #e5e5e5 url('/assets/images/bg-content-box.gif') top left repeat-x;
                            padding: 10px; border-radius: 7px;">INIT DATA
                            <asp:TextBox class="cls" ID="txtPOLSearch" runat="server" Width="150px" TabIndex="16"
                                placeholder="POL"></asp:TextBox>
                            <asp:TextBox class="cls" ID="txtCarrNameSearch" runat="server" Width="70px" TabIndex="16"
                                placeholder="CARRIER"></asp:TextBox>
                            <asp:TextBox class="cls" ID="txtPODSearch" runat="server" Width="150px" TabIndex="17"
                                placeholder="POD"></asp:TextBox>
                            <asp:Button ID="btnInit" CssClass="button" runat="server" TabIndex="15" Text="Initialize Data"
                                OnClick="btnInit_Click" />
                        </span>
                        <%} %>
                        <input type="button" style="float: right; margin-left: 10px;" class="button" value="Edit"
                            id="btnsave" runat="server" visible="false" />
                        <input id="btnShowAddNewBox" type="button" style="float: right;" class="button" value="Add new"
                            runat="server" visible="false" />
                        <div class="clear">
                        </div>
                        <asp:Label ID="lblerror" CssClass="msg-error" runat="server" Style="display: inline-block;
                            margin: 5px;"></asp:Label><br />
                    </div>
                    <div class="content-box-header">
                        <h3>
                            <%=strInforServiceAreas %>
                        </h3>
                        <div style="padding-left: 5px; padding-top: 5px;">
                        </div>
                    </div>
                    <div class="clear">
                    </div>
                    <div id="divContent">
                        <fieldset>
                            <asp:Repeater ID="rptData" runat="server">
                                <ItemTemplate>
                                    <%# this.RenderGroup(Eval("GroupAreas") as string) %>
                                    <tr onmouseover="this.style.background='#dbf0c9'" onmouseout="this.style.background='#ffffff'"
                                        priceid='<%#Eval("ID") %>'>
                                        <td align="center" title="Index" width="28px" style="min-width: 28px; max-width: 28px;
                                            overflow: hidden;">
                                            <%# DataBinder.Eval(Container.DataItem, "Index")%>
                                        </td>
                                        <td width="100px" style="min-width: 100px; max-width: 100px; overflow: hidden;">
                                            <b>
                                                <%# DataBinder.Eval(Container.DataItem, "SerAreaName")%>
                                            </b>
                                        </td>
                                        <%if( Session["PriceAreasPol"]!=null &&  Session["PriceAreasPol"].ToString()!="") {%>
                                        <td width="120px" style="min-width: 120px; max-width: 120px; overflow: hidden;">
                                            <%# DataBinder.Eval(Container.DataItem, "PolName")%>
                                        </td>
                                        <%} %>
                                        <%if( Session["PriceAreasPod"]!=null &&  Session["PriceAreasPod"].ToString()!="") {%>
                                        <td width="100px" style="min-width: 100px; max-width: 100px; overflow: hidden;">
                                            <%# DataBinder.Eval(Container.DataItem, "PodName")%>
                                        </td>
                                        <%} %>
                                        <td width="70px" editable="true" style="min-width: 70px; max-width: 70px; overflow: hidden;"
                                            code="DC20" title='<%#GetCellTitle(Eval("DC20")) %>' class='<%#GetCellClass(Eval("DC20"))%>'>
                                            <%#GetCellValue(DataBinder.Eval(Container.DataItem, "DC20"))%>
                                        </td>
                                        <td width="70px" editable="true" style="min-width: 70px; max-width: 70px; overflow: hidden;"
                                            code="DC40" title='<%#GetCellTitle(Eval("DC40")) %>' class='<%#GetCellClass(Eval("DC40"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "DC40"))%>
                                        </td>
                                        <td width="70px" editable="true" style="min-width: 70px; max-width: 70px; overflow: hidden;"
                                            code="HC40" title='<%#GetCellTitle(Eval("HC40")) %>' class='<%#GetCellClass(Eval("HC40"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "HC40"))%>
                                        </td>
                                        <td width="70px" editable="true" style="min-width: 70px; max-width: 70px; overflow: hidden;"
                                            code="RF20" title='<%#GetCellTitle(Eval("RF20")) %>' class='<%#GetCellClass(Eval("RF20"))%>'>
                                            <%#GetCellValue( DataBinder.Eval(Container.DataItem, "RF20"))%>
                                        </td>
                                        <td width="70px" editable="true" style="min-width: 70px; max-width: 70px; overflow: hidden;"
                                            code="RF40" title='<%#GetCellTitle(Eval("RF40")) %>' class='<%#GetCellClass(Eval("RF40"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "RF40"))%>
                                        </td>
                                        <td width="70px" editable="true" style="min-width: 70px; max-width: 70px; overflow: hidden;"
                                            code="Validity" title='<%#GetCellTitle(Eval("Validity")) %>' class='<%#GetCellClass(Eval("Validity"))%>'>
                                            <%# GetCellValue(DataBinder.Eval(Container.DataItem, "Validity"))%>
                                        </td>
                                        <td editable="true" code="Note" title='<%#GetCellTitle(Eval("Note")) %>' class='<%#GetCellClass(Eval("Note"))%>'>
                                            <%#GetCellValue( DataBinder.Eval(Container.DataItem, "Note"))%>
                                        </td>
                                        <td width="50px" style="color: #0000ff; min-width: 50px; max-width: 50px; overflow: hidden;"
                                            code="update">
                                            <%#DataBinder.Eval(Container.DataItem, "LastUpdate")%>
                                        </td>
                                        <%if ((Session["PriceAreas"] != null) && (int.Parse(Session["PriceAreas"].ToString()) >= 3))
                                          {%>
                                        <td align="center">
                                            <%# DataBinder.Eval(Container.DataItem, "Action")%>
                                        </td>
                                        <%} %>
                                    </tr>
                                </ItemTemplate>
                                <HeaderTemplate>
                                    <div autofit="true" style="">
                                        <table editcellcontent="true" cellspacing="0" cellpadding="0" width="auto" border="0"
                                            class="adminlist" resizeable="true">
                                            <thead>
                                                <tr>
                                                    <th rowspan="2" align="center">
                                                        Index
                                                    </th>
                                                    <th rowspan="2" align="center" class="resizeable">
                                                        Service Areas
                                                    </th>
                                                    <%if( Session["PriceAreasPol"]!=null &&  Session["PriceAreasPol"].ToString()!="") {%>
                                                    <th align="center" class="resizeable unviewable" code="POL">
                                                        POL
                                                    </th>
                                                    <%} %>
                                                    <%if( Session["PriceAreasPod"]!=null &&  Session["PriceAreasPod"].ToString()!="") {%>
                                                    <th align="center" class="resizeable unviewable" code="POD">
                                                        POD
                                                    </th>
                                                    <%} %>
                                                    <th align="center" class="resizeable unviewable" code="DC20">
                                                        DC20
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="DC40">
                                                        DC40
                                                    </th>
                                                    <th class="resizeable unviewable" code="HC40">
                                                        HC40
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="RF20">
                                                        RF20
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="RF40">
                                                        RF40
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="Validity">
                                                        Validity
                                                    </th>
                                                    <th align="center" class="resizeable unviewable" code="Description">
                                                        Note
                                                    </th>
                                                    <th align="center" code="update">
                                                        Update
                                                    </th>
                                                    <%if ((Session["PriceAreas"] != null) && (int.Parse(Session["PriceAreas"].ToString()) >= 3))
                                                  {%>
                                                    <th align="center" width="100px">
                                                        Action
                                                    </th>
                                                    <%} %>
                                                </tr>
                                            </thead>
                                </HeaderTemplate>
                                <FooterTemplate>
                                    </TABLE> </div>
                                </FooterTemplate>
                            </asp:Repeater>
                        </fieldset>
                        <div class="clear">
                        </div>
                        <div id="footer">
                            <%=strPager%>
                        </div>
                    </div>
                </div>
                </form>
            </div>
        </div>
    </div>
    <span id="ruler" style="visibility: hiddens; white-space: nowrap"></span>
</body>
</html>
